<template>
	<view class="sideBox">
		<!-- 头部 -->
		<view class="header">
			<text>失物招领</text>
			<navigator url="" hover-class="navigator-hover">
				<text @click="issue">+</text>
			</navigator>
			
		</view>
		<!-- 全部内容 -->
		<view class="content">
			<!-- 第一列 -->
			<view class="con1"  v-for="(item, index) in list"  :key='item.id' @click="goDetails(item.id)">
				<!-- 上面的头像信息 -->
				<view class="con1_1">
					<view class="con1_1_1">
						<navigator url="" hover-class="navigator-hover" class="href1">
							<image :src="item.avatarurl"></image>
							<text>{{item.username}}</text>
						</navigator>
					</view>
					
					<text class="con1_1_2">{{item.issueTime}}</text>
				</view>
				<!-- 下面招领的内容信息 -->
				<navigator url="" hover-class="navigator-hover" class="href2">
					<view class="con1_2">
						<text>{{item.last_found_title}}</text>
						<text>{{item.last_found_withtitle}}</text>
					</view>
				</navigator>
			</view>
			
		</view>
	</view>
	
</template>

<script>
	export default {
		data(){
			return {
				list:[]
				// {
				// 	imgSrc:'https://qincore.cn/xbk/index/18-12-06.png',
				// 	username:'韩梅梅',
				// 	// issueTime:'13:22',
				// 	last_found_title:'钥匙招领',
				// 	last_found_withtitle:'我捡到一把寝室钥匙，谁掉了来领取'
					
				// },{
				// 	imgSrc:'https://qincore.cn/xbk/index/18-12-06.png',
				// 	username:'李磊',
				// 	// issueTime:'2021/3/9 12:00',
				// 	last_found_last_found_title:'钱夹',
				// 	last_found_withtitle:'谁掉了一个钱夹，速来领！！！'
				// },
				
			}
		},
		methods:{
			getCon(){
				this.$http({
					url:'/lastfound/findAllLastFound'
				}).then(res => {
					console.log(res.data.data);
					this.list = res.data.data;
				})
			},
			goDetails(id){
				uni.navigateTo({
				    url: `/pages/lostDetail/lostDetail?id=${id}`
				});
			},
			issue(){
				uni.redirectTo({
					url:'../issueLost/issueLost'
				})
			}
		},
		mounted(){
			this.getCon();
		}
	
	// wx.login({
	//   success (res) {
	//     if (res.code) {
	//       //发起网络请求
	//       this.$http({
	//         url: 'https://example.com/onLogin',
	//         data: {
	//           code: res.code
	//         }
	//       })
	//     } else {
	//       console.log('登录失败！' + res.errMsg)
	//     }
	//   }
	// }
	
	// })
	}
</script>

<style lang="less" scoped>
.sideBox {
	width: 750rpx;
	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 750rpx;
		font-size: 44rpx;
		font-weight: 600;
		padding-top: 40rpx;
		text:nth-child(1) {
			font-family: 'Gill';
			margin-left: 30rpx;
			margin-bottom: 60rpx;
		}
		navigator{
				margin-right: 30rpx;
				margin-bottom: 70rpx;
			text {
				// margin-right: 30rpx;
				font-size: 56rpx;
				// margin-bottom: 70rpx;
			}
		}
		// :nth-child(1) {
		// 	margin-right: 30rpx;
		// 	font-size: 56rpx;
		// 	margin-bottom: 70rpx;
			
		// }
		
	};
	.content {
		width: 695rpx;
		margin: 0 auto;
		// justify-content: center;
		// border: 1px solid red;
		.con1 {
			padding: 20rpx 30rpxs;
			.con1_1 {
				display: flex;
				justify-content: space-between;
				align-items: center;
				.con1_1_1 {
					navigator {
						display: flex;
						align-items: center;
						image {
							width: 80rpx;
							height: 80rpx;
						}
						text {
							font-weight: 600;
							padding-left: 20rpx;
						}
					}
					
				};
				.con1_1_2 {
					font-size: 32rpx;
					color: #878787;
				}
				
			};
			.con1_2 {
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				margin-left: 80rpx;
				margin-bottom: 20rpx;
				border-bottom: 1px solid #eee;
				text:nth-child(1) {
					color: #000;
					font-size: 32rpx;
					font-weight: 600;
					padding-left: 20rpx;
					padding-top: 10rpx;
				};
				text:nth-child(2) {
					font-size: 32rpx;
					color: #878787;
					padding: 25rpx 20rpx;
				}
			}
		}
	};
}

</style>
